package cn.teduymdj.jxc.controller;


import cn.teduymdj.jxc.myAnnotation.LogAnnotation;
import cn.teduymdj.jxc.pojo.dto.LogSelectConditionDTO;
import cn.teduymdj.jxc.pojo.entity.Log;
import cn.teduymdj.jxc.pojo.vo.LogListItemVO;
import cn.teduymdj.jxc.service.LogService;
import cn.teduymdj.jxc.web.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 日志controller层
 */
@RestController
@RequestMapping("/log")
public class LogController {
	
	@Autowired
	private LogService logService;
	
	/**
	 * 分页查询日志信息
	 * @param type 日志类型
	 * @param trueName 操作人员
	 * @param sTime 开始时间
	 * @param eTime 结束时间
	 * @param page 当前页数
	 * @param rows 每页条数
	 * @return
	 */
	//日志保存注解,不用管:李柯辰
	@LogAnnotation(content = "分页查询日志信息", type = Log.SELECT_ACTION)
	@RequestMapping("/list")
	public JsonResult<List<LogListItemVO>> list(@RequestBody LogSelectConditionDTO logSelectConditionDTO){
		List<LogListItemVO> logList =
				logService.getLogList(logSelectConditionDTO);
		return JsonResult.ok(logList);

	}

}
